<template>
  <div class="">
    <div class="imgs">
      <img :src="detaillist.url" alt="" style="width: 500px; height: 400px;"  />
      <p style="text-align: center;">{{ detaillist.title }}</p>
    </div>
    <div>
        <p v-html="detaillist.content"></p>
    </div>
  </div>
</template>

<script setup>
import { ref, reactive, toRefs } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router";
import { getDetail } from "../utils/api";
const route = useRoute();
const detail = reactive({
  id: route.query.id,
});
const detaillist = reactive({

  title: "",
  url: "",
  content: "",
});
console.log(detail);
getDetail(detail).then((res) => {
  console.log(res);
  detaillist.title = res.data.data.title;
  detaillist.url = res.data.data.image.url;
  detaillist.content = res.data.data.content;
});
</script>

<style lang="scss">
.imgs{
    width: 700px;
    margin: auto;
    
}
</style>
